package com.xcexample.electronicclasscard.kaoqin

import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.xcexample.electronicclasscard.R


class WorkAdapter :
    BaseQuickAdapter<WorkHistoryData.Data, BaseViewHolder>(R.layout.item_work) {

    override fun convert(helper: BaseViewHolder, item: WorkHistoryData.Data) {
        helper.setText(R.id.id, "${item.id}")
        helper.setText(R.id.id_card, item.id_card)
        helper.setText(R.id.name, item.name)
        helper.setText(R.id.class_name, item.class_name)
        helper.setText(R.id.sign_time, item.sign_time)
        helper.setText(R.id.sign_text, item.sign_text)
        if (item.is_sign==1){

        }
        var view = helper.getView<TextView>(R.id.sign_text)
        if (item.is_sign==1) {
            view.setTextColor(context.resources.getColor(R.color._30cc78))
        } else {
            view.setTextColor(context.resources.getColor(R.color.f34a4a))

        }
    }
}
